package com.lr.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	
	public static Date getStringToDate(String date){
		Date datetime=null;
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			datetime = sf.parse(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return datetime;
	}
	
	public static String getDateToString(Date date){
		String datetime=null;
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			datetime=sf.format(date);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return datetime;
	}

}
